package br.com.fogas.webservice.repository.soap;

import android.content.Context;
import br.com.fogas.utils.exception.ParseXmlException;
import br.com.fogas.webservice.exception.RespostaWebServiceException;
import br.com.fogas.webservice.exception.SemConexaoInternetException;
import br.com.fogas.webservice.exception.ServidorForaException;
import br.com.fogas.webservice.exception.TempoEsperaRespostaException;
import br.com.fogas.webservice.exception.WebServiceException;
import br.com.fogas.webservice.parser.datahora.DataHoraServidorEnvelope;
import br.com.fogas.webservice.parser.datahora.DataHoraServidorResponse;
import br.com.fogas.webservice.repository.IRepositoryHandler;
import br.com.fogas.webservice.soap.impl.DataHoraServidorSOAP;

public class DataHoraServidorRepository implements IRepositoryHandler<DataHoraServidorResponse> {
	
	private Context context;

	public DataHoraServidorRepository(Context context) {
		this.context = context;
	}

	@Override
	public DataHoraServidorResponse getResponse()
			throws SemConexaoInternetException, ParseXmlException,
			TempoEsperaRespostaException, ServidorForaException,
			RespostaWebServiceException, WebServiceException {
		DataHoraServidorSOAP soap = new DataHoraServidorSOAP(context,
				new DataHoraServidorEnvelope());
		return soap.getResponse();
	}
}